import { login } from "../../api/login";

const getDefaultState = () => {
  return {
   
  };
};

const state = getDefaultState();

const mutations = {
 
};

const actions = {
  // user login
  login({ commit }, userInfo) {
    const { admin, pws } = userInfo;
    return new Promise((resolve, reject) => {
      login({ admin: admin.trim(), pws: pws })
        .then((response) => {
          resolve(response);
        })
        .catch((error) => {
          reject(error);
        });
    });
  }
};

export default {
  namespaced: true,
  state,
  mutations,
  actions,
};
